package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

// 消息详细信息表
@Getter
@Setter
public class MessageInfo extends BaseDomain {
    public static final Integer TYPE_PUSH = 0;  // 系统推送
    public static final Integer TYPE_EXAMINE = 1;   // 审核通知

    private Long targetId;  // 消息主体id，例如文章id

    private String title;   // 消息标题

    private String content; // 消息内容

    private Integer msgType = TYPE_PUSH;    // 消息类型

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createtime;    // 创建时间

    public String getMsgTypeName() {
        String temp = "系统推送";
        if (msgType == TYPE_EXAMINE) {
            temp = "审核通知";
        }
        return temp;
    }
}